let vm = new Vue({
    el: "form",
    data: {
        user: {
            username: "",
            password: ""
        }
    },
    methods: {
        prevent() {
            if (event.keyCode == 32) {
                event.returnValue = false;
            }
        },
        login() {
            axios.post("/user/login", vm.user).then(function (response) {
                if (response.data.code == 200) {
                    location.href = "/index.html";
                } else {
                    alert(response.data.msg);
                }
            });
        }
    }
});